import request from "@/utils/request";

/* 角色列表查询*/
export function queryListRequest(data) {
  return request({
    url: "/management-admin/sysFrontRole/queryByPage",
    method: "post",
    data,
  });
}

/* 获取菜单  */
export function queryTreeRequest(data) {
  return request({
    url: "/management-admin/sysFrontMenu/list",
    method: "post",
    data,
  });
}

// 新增/保存角色
export function saveRoleRequest(data) {
  return request({
    url: "/management-admin/sysFrontRole/save",
    method: "post",
    data,
  });
}

// 删除角色
export function deleteRoleRequest(id) {
  return request({
    url: "/management-admin/sysFrontRole/delete?id=" + id,
    method: "get",
  });
}

// 根据id查详情
export function queryRoleDetailRequest(id, parms) {
  return request({
    url: "/management-admin/sysFrontRole/" + id,
    method: "get",
    params: parms,
  });
}

//角色分配用户操作
export function assignUserRequest(data) {
  return request({
    url: "/management-admin/sysFrontRole/linkUser",
    method: "post",
    data,
  });
}

//角色 取消用户授权
export function unAssignUserRequest(data) {
  return request({
    url: "/management-admin/sysFrontRole/cancelContact",
    method: "post",
    data,
  });
}

//默认配置检查
export function checkDefaultConfig() {
  return request({
    url: "/management-admin/sysFrontRole/checkDefalutRole",
    method: "get",
  });
}
